package com.fhz.loginmvvm.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.fhz.loginmvvm.Data
import com.fhz.loginmvvm.User
import com.fhz.loginmvvm.callback.ApiResponse
import com.fhz.loginmvvm.repository.MainRepository

/**
 * 时间:2023/3/24
 * @author Mr.Feng
 * 简述: TODO
 */
class MainViewModel(private val repository : MainRepository):ViewModel() {


    val user:MutableLiveData<ApiResponse<User>> = MutableLiveData()

    fun login(name:String,pwd:String) : LiveData<ApiResponse<User>>{
        return repository.login(name,pwd)
    }

    fun login4Local(uid:Int): LiveData<Data>{
        return repository.login4Local(uid)
    }


}